import request from '@/utils/request'

// 用来获取用户频道名字的接口
export const getChannel = () => request({
  url: '/app/v1_0/user/channels'
})
// 频道新闻推荐
export const recommendedChannel = params => request({
  url: '/app/v1_1/articles',
  params
})
// 获取全部频道
export const getAllChannels = () => request({
  url: '/app/v1_0/channels'
})
// 批量修改用户频道列表（部分覆盖）
export const addUserChannels = (channel) => request({
  method: 'patch',
  url: '/app/v1_0/user/channels',
  data: {
    channels: [channel]
  }
})
// 删除指定用户频道
export const delUserChannels = (channelId) => request({
  method: 'DELETE',
  url: `/app/v1_0/user/channels/${channelId}`
})
